package com.cloud.lan.integration.submail.sms.entity;

import com.alibaba.fastjson.JSON;
import lombok.Data;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zhouquan on 2022/4/2.
 */
@Data
public class SmsSendReq {

    /**
     * 短信模板ID
     */
    private String templateId;

    private List<SmsSendModel> modelList;

    public static void main(String[] args){
        SmsSendReq sendReq = new SmsSendReq();
        sendReq.setTemplateId("Ki4tG2");

        List<SmsSendModel> modelList = new ArrayList<>();

        SmsSendModel m1 = new SmsSendModel();
        m1.setTo("13761231450");
        Map<String,String> vars1 = new HashMap<>();
        vars1.put("lanDays","3");
        vars1.put("lanNum","30");
        m1.setVars(vars1);
        modelList.add(m1);

        SmsSendModel m2 = new SmsSendModel();
        m2.setTo("13681937143");
        Map<String,String> vars2 = new HashMap<>();
        vars2.put("lanDays","4");
        vars2.put("lanNum","40");
        m2.setVars(vars2);
        modelList.add(m2);

        SmsSendModel m3 = new SmsSendModel();
        m3.setTo("13671617811");
        Map<String,String> vars3 = new HashMap<>();
        vars3.put("lanDays","5");
        vars3.put("lanNum","50");
        m3.setVars(vars3);
        modelList.add(m3);

        SmsSendModel m4 = new SmsSendModel();
        m4.setTo("13813948485");
        Map<String,String> vars4 = new HashMap<>();
        vars4.put("lanDays","5");
        vars4.put("lanNum","50");
        m4.setVars(vars4);
        modelList.add(m4);

        sendReq.setModelList(modelList);

        System.out.println(JSON.toJSONString(sendReq));
    }
}
